package im.domain;

import jade.content.Concept;
import jade.core.AID;

public class SLA implements Concept{
	
	private String servizio;
	private AID subscriberA;
	private AID subscriberB;
	private Integer tempoRispMax;
	private Float	tassoArriviMax;
	private Float	successRateMin;
	
	public SLA(){
		
	}
	public String toString(){
		return subscriberA.toString()+"-"+subscriberB.toString()+"-"+servizio;
	}
	public boolean equals(Object o){
		if(!(o instanceof SLA))throw new ClassCastException();
		SLA t = (SLA)o;
		if(t.getServizio()!=null && 
				!t.getServizio().equals(this.servizio))return false;
		
		if(t.getSubscriberA()!=null && 
				!t.getSubscriberA().equals(this.subscriberA))return false;
		
		if(t.getSubscriberB()!=null && 
				!t.getSubscriberB().equals(this.subscriberB))return false;
		
		if(t.getSuccessRateMin()!=null 
				&& !t.getSuccessRateMin().equals(this.successRateMin))return false;
		
		if(t.getTempoRispMax()!=null 
				&& !t.getTempoRispMax().equals(this.tempoRispMax))return false;
		
		if(t.getTassoArriviMax()!=null 
				&& !t.getTassoArriviMax().equals(this.tassoArriviMax))return false;
		
		return true;
	}
	public SLA (AID aidA, AID aidB){
		setSubscriberA(aidA);
		setSubscriberB(aidB);
	}
	
	public AID getSubscriberA() {
		return subscriberA;
	}
	public void setSubscriberA(AID subscriberA) {
		this.subscriberA = subscriberA;
	}
	public AID getSubscriberB() {
		return subscriberB;
	}
	public void setSubscriberB(AID subscriberB) {
		this.subscriberB = subscriberB;
	}
	public Integer getTempoRispMax() {
		return tempoRispMax;
	}
	public void setTempoRispMax(Integer tempoRispMax) {
		this.tempoRispMax = tempoRispMax;
	}
	public Float getTassoArriviMax() {
		return tassoArriviMax;
	}
	public void setTassoArriviMax(Float tassoArriviMax) {
		this.tassoArriviMax = tassoArriviMax;
	}
	public Float getSuccessRateMin() {
		return successRateMin;
	}
	public void setSuccessRateMin(Float successRateMin) {
		this.successRateMin = successRateMin;
	}
	public String getServizio() {
		return servizio;
	}
	public void setServizio(String servizio) {
		this.servizio = servizio;
	}
	
}
